﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Proggy.Web.Cms.PropertyTypes;
using Proggy.Web.Cms.ContentModel;
using System.Web.Mvc;
using System.ComponentModel;

namespace Proggy.Web.Cms.Core.ViewModels
{
    public class ConfigureDragAndDropPartViewModel
    {
        // prop type
        [ContentModelPropertyType("", "","")]
        public PropertyTypeBase PropertyType { get; set; }

        // Margin
        [DisplayName("Margin left")]
        public int MarginLeftInt { get; set; }
        [DisplayName("Margin right")]
        public int MarginRightInt { get; set; }
        [DisplayName("Margin top")]
        public int MarginTopInt { get; set; }
        [DisplayName("Margin bottom")]
        public int MarginBottomInt { get; set; }
        [DisplayName("Margin values type")]
        public string MarginType { get; set; }
        public string Margin
        {
            get
            {
                return
                    this.MarginTopInt + MarginType + " " +
                    this.MarginRightInt + MarginType + " " +
                    this.MarginBottomInt + MarginType + " " +
                    this.MarginLeftInt + MarginType;
                //return this.MarginInt.ToString() + this.MarginType;
            }
        }


        // width
        [DisplayName("Width (0 = auto)")]
        public int WidthInt { get; set; }
        [DisplayName("Width value type")]
        public string WidthType { get; set; }
        public string Width
        {
            get
            {
                return
                    this.WidthInt == 0 ?
                            "auto"
                            :
                            this.WidthInt + this.WidthType;
            }
        }


        // float
        [DisplayName("Float")]
        public string Float { get; set; }
        public IEnumerable<SelectListItem> FloatSelectList
        {
            get
            {
                return new List<SelectListItem> { 
                    new SelectListItem{ Text="none", Value="none" },
                    new SelectListItem{ Text="left", Value="left" },
                    new SelectListItem{ Text="right", Value="right" }
                    
                };
            }
        }


        // clear
        [DisplayName("Clear")]
        public string Clear { get; set; }
        public IEnumerable<SelectListItem> ClearSelectList
        {
            get
            {
                return new List<SelectListItem> { 
                    
                    new SelectListItem{ Text="both", Value="both" },
                    new SelectListItem{ Text="none", Value="none" },
                    new SelectListItem{ Text="left", Value="left" },
                    new SelectListItem{ Text="right", Value="right" }
                    
                };
            }
        }


        // em px select list
        public IEnumerable<SelectListItem> TypesSelectList
        {
            get
            {
                return new List<SelectListItem> { 
                 new SelectListItem{ Text="em", Value="em" },
                 new SelectListItem{ Text="px", Value="px" }
            };
            }
        }
    }
}
